package day_240507;

public class e2 {
    public int shakeHands(int n){
        if (n == 1){
            return 0;
        }
        else if (n == 2){
            return 1;
        }
        else if (n == 3){
            return 3;
        }
        else return shakeHands(n-1) + n-1;
    }

    public static void main(String[] args) {
        e2 shake = new e2();
        System.out.println(shake.shakeHands(5));
    }
}
